package io.github.bloquesoft.entity.definition;

import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

public abstract class AbstractEntityDefinition implements EntityDefinition
{
    @Getter
    private final String id;

    @Setter
    @Getter
    private PojoPropertyDefinition primaryKeyProperty;

    @Getter
    private List<PojoPropertyDefinition> pojoPropertyList = new ArrayList<>();

    @Getter
    private List<ListPropertyDefinition> listPropertyList = new ArrayList<>();

    public AbstractEntityDefinition(String id)
    {
        this.id = id;
    }

    public void addPojoProperty(PojoPropertyDefinition property)
    {
        this.pojoPropertyList.add(property);
    }

    public void addListProperty(ListPropertyDefinition property)
    {
        this.listPropertyList.add(property);
    }

    public List<PojoPropertyDefinition> getPojoPropertyList()
    {
        return this.pojoPropertyList;
    }

    public List<ListPropertyDefinition> getListPropertyList()
    {
        return this.listPropertyList;
    }
}